﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManualPutaway.aspx.cs" Inherits="WMS6.Web.Inbound.ManualPutaway" meta:resourcekey="Page" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ManualPutaway</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>
    <script src="../Js/util.js" id="js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>  
    <script src="../Js/Verification.js" type="text/javascript"></script>  
    <base target="_self" />   
    <script type="text/javascript">
       
        //初始化页面
        window.onload = function(){
            var actionID = window.dialogArguments;
            if(actionID != "" && actionID != null)
            {
                //document.getElementById("hdnActionID").value = actionID;
                var array = actionID.split(',');
                initQueryPage(array[0],array[1]);
            }
            else
            {
                initDetailPage();
            }
        }
        
        //检查用户输入数量是否正确
        function checkQty()
        {
            if(dataVer._Is123(document.getElementById('txtQty'),'lblMsg'))
            {
                var originQty = document.getElementById("hdnQty").value;    //原始数量
                var inputQty =  document.getElementById("txtQty").value;    //用户输入数量
                if(parseInt(inputQty) > parseInt(originQty) || parseInt(inputQty) <= 0)
                {
                    document.getElementById("lblMsg").innerText = "请输入正确的放货数量!";
                    document.getElementById("lblMsg").style.display = "block";
                     document.getElementById("txtQty").value =originQty;
                    document.getElementById("txtQty").focus();
                    return false;
                }
                else
                {
                    return true;
                }
            }                  
        }
        
        //Textbox回车事件
        function EnterTextBox(obj)
        {
             if(event.keyCode == 13 && document.all[obj].value != "")
             {
                 event.keyCode = 9;
                 event.returnValue = false;
                 document.getElementById("btnPutAway").click();
             }
        }

    </script>
</head>
<body>
    <form id="form1" runat="server" defaultbutton="btnSave">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom"><asp:Label ID="lblManualPA" runat="server" 
                            CssClass="label_header" Text="手动上架" meta:resourcekey="lblManualPA"></asp:Label></td>
                    <td><asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCancel%>" 
                            AccessKey="c" onclick="btnGoBack_Click"/></td>
                    <td><asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>" 
                            AccessKey="s" onclick="btnSave_Click"  /></td>
                </tr>
            </table>
        </div>
        
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                meta:resourcekey="lblMsg"></asp:Label>
        </div>
        <table style="width:800px">
            <tr>
                <td style="width:540px;">
                    <div id="div_menu" style="width:540px;">
                        <div style="float: left; width: 8px;">
                            <div class="tabL" id="divL1"></div>
                        </div>
                        <div style="float:left;" class="tabLabelCont tabCur" onclick="setTab('one',1,3)" id="divM1">
                            <asp:Label ID="one1" CssClass="hover" runat="server" 
                                meta:resourcekey="one1">按照货位</asp:Label></div>
                        <div style="float: left; margin-right: 2px;">
                            <div class="tabR" id="divR1"></div>
                        </div>
                        
                        <div style="float: left; width: 8px;">
                            <div class="tabL_1" id="divL2"></div>
                        </div>
                        <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,3)" id="divM2">
                            <asp:Label ID="one2" CssClass="navigationlabel" runat="server" 
                                meta:resourcekey="one2">按照排列层</asp:Label></div>
                        <div style="float: left; margin-right: 2px;">
                            <div class="tabR_1" id="divR2"></div>
                        </div>
                        
                        <div style="float: left; width: 8px;">
                            <div class="tabL_1" id="divL3"></div>
                        </div>
                        <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab('one',3,3)" id="divM3">
                            <asp:Label ID="one3" CssClass="navigationlabel" runat="server" 
                                meta:resourcekey="one3">批量放货</asp:Label></div>
                        <div style="float: left; margin-right: 2px;">
                            <div class="tabR_1" id="divR3"></div>
                        </div>
                       
                    </div>
                    <div id="div_content" style="width:550px; height:85px;">
                         <div id="con_one_1" style="display: block; width:550px;">
                             <table width="540px" style="display: block; margin-left: 10px; margin-top: 10px;">
                                 <tr>
                                     <td width="180">
                                         <asp:Label ID="lblLocID" runat="server" CssClass="label" Text="货位" 
                                             meta:resourcekey="lblLocID"></asp:Label><font color="red">*</font>
                                     </td>
                                     <td width="180">
                                         &nbsp;</td>
                                     <td width="180">
                                         &nbsp;</td>
                                 </tr>
                                 <tr>
                                     <td>
                                         <asp:TextBox ID="txtLocID" runat="server" CssClass="textbox" MaxLength="20" 
                                             onkeypress="return EnterTextBox('txtLocID');"  onkeyUp="SearchDataAjax(this,'LOC','txtLocID');return false;"  onblur="LoseFocus();return false"
                                             meta:resourcekey="txtLocID" ></asp:TextBox> <%--<img src="../Images/icon_find.gif" id="imgOwnerID" runat="server" alt="select one item" class="img" onclick="selectLoc();"/>--%>
                                     </td>
                                     <td>
                                         &nbsp;</td>
                                     <td>
                                         &nbsp;</td>
                                 </tr>
                                 <tr style=" margin-top:10px; ">
                                     <td width="360" colspan="2">
                                         <asp:Label ID="lblFormatExample" runat="server" CssClass="label" Text="格式:" 
                                             meta:resourcekey="lblFormatExample"></asp:Label>
                                     </td>
                                     <td width="180">
                                         &nbsp;</td>
                                 </tr>
                             </table>
                         </div>
                         
                         <div id="con_one_2" style="display: none; width:550px;">
                             <table width="540px" style="display: block; margin-left: 10px; margin-top: 10px;">
                                 <tr>
                                     <td></td>
                                     <td></td>
                                     <td></td>
                                     <td></td>
                                 </tr>
                             </table>
                         </div>
                         
                         <div id="con_one_3" style="display: none; width:550px;">
                             <table width="540px" style="display: block; margin-left: 10px; margin-top: 10px;">
                                 <tr>
                                     <td></td>
                                     <td></td>
                                     <td></td>
                                     <td></td>
                                 </tr>
                             </table>
                         </div>
                         
                    </div>
                </td>
                <td style="width:230px;" valign="bottom">
                    <table style="width:100%; height:100%; margin-left:10px;">
                        <tr>
                            <td><asp:Label ID="lblSkuID" runat="server" CssClass="label" Text="货品代码" 
                                    meta:resourcekey="lblSkuID"></asp:Label></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:TextBox ID="txtSkuID" runat="server" CssClass="textbox" MaxLength="30" 
                                    meta:resourcekey="txtSkuID"></asp:TextBox></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblQty" runat="server" CssClass="label" Text="数量" 
                                    meta:resourcekey="lblQty"></asp:Label></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:TextBox ID="txtQty" runat="server" CssClass="textbox" MaxLength="30" 
                                    Width="100px" onkeypress="return EnterTextBox('txtQty');" 
                                    meta:resourcekey="txtQty" ></asp:TextBox>
                                <asp:Label ID="lblUomID" runat="server" CssClass="label" Width="50px" 
                                    meta:resourcekey="lblUomID"></asp:Label>
                            </td>
                            <td><asp:Button ID="btnPutAway" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnPutAway%>" 
                                    onclick="btnPutAway_Click"   /></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr style="height:10px;"><td></td></tr>
            <tr >
                <td colspan="2">
                    <table style="margin-left:10px;">
                        <tr>
                            <td>
                                <asp:GridView ID="gvManualPutAway" runat="server" AutoGenerateColumns="False" DataKeyNames="Qty" 
                                    CssClass="gridview" onrowdatabound="gvManualPutAway_RowDataBound"  
                                    Width="780px" onrowdeleting="gvManualPutAway_RowDeleting" 
                                    meta:resourcekey="gvManualPutAway" >
                                 <FooterStyle CssClass="GridViewFooterStyle" />
                                 <RowStyle CssClass="GridViewRowStyle" />
                                 <HeaderStyle CssClass="GridViewHeaderStyle" />
                                 <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                 <Columns>
                                     <asp:TemplateField HeaderText="取消" FooterText="取消" 
                                         meta:resourcekey="Cancel">
                                         <ItemTemplate>
                                             <asp:LinkButton ID="lnkbtnDelete" runat="server" CausesValidation="False" 
                                                 CommandName="Delete" Text="&lt;img 
                                                 src=&quot;../Images/delete.gif&quot; class=&quot;img&quot; style=&quot;border:none 0px blue;&quot; 
                                                 alt=&quot;delete&quot; __designer:mapid=&quot;ba9&quot;/&gt;" 
                                                 meta:resourcekey="lnkbtnDelete"></asp:LinkButton>
                                         </ItemTemplate>
                                         <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center"/>
                                     </asp:TemplateField>
                                    <asp:BoundField HeaderText="序号" FooterText="序号" 
                                         meta:resourcekey="No">
                                         <ItemStyle CssClass="GridViewRowWidth_40" />
                                     </asp:BoundField>
                                     <asp:BoundField DataField="ToLoc" HeaderText="货位" FooterText="货位" 
                                         SortExpression="ToLoc" meta:resourcekey="ToLoc">
                                         <ItemStyle CssClass="GridViewRowWidth_150" />
                                     </asp:BoundField>
                                     <asp:TemplateField FooterText="放货数量" HeaderText="放货数量" SortExpression="Qty" 
                                         meta:resourcekey="Qty">
                                        <ItemTemplate>
                                            <asp:Label ID="lblQty" runat="server" 
                                                Text='<%# GetPreferenceDigit(Eval("Qty").ToString()) %>' 
                                                meta:resourcekey="lblQtyResource2"></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle CssClass="GridViewRowWidth_150" />
                                     </asp:TemplateField>
                                     <asp:BoundField DataField="Uom" HeaderText="单位" FooterText="单位" 
                                         SortExpression="Uom" meta:resourcekey="Uom">
                                         <ItemStyle CssClass="GridViewRowWidth_150" />
                                     </asp:BoundField>
                                     <asp:BoundField DataField="CondititonCode" HeaderText="货品属性" FooterText="货品属性" 
                                         SortExpression="CondititonCode" meta:resourcekey="CondititonCode">
                                         <ItemStyle CssClass="GridViewRowWidth_150" />
                                     </asp:BoundField>
                                 </Columns>
                             </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <input type="hidden" id="hdnQty" runat="server" />
        <input type="hidden" id="hdnRtnValue" runat="server" />
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    <!--
    window.returnValue = document.getElementById("hdnRtnValue").value;
    if(window.returnValue != "")
    {
        window.close();
    }
   //-->
</script>
<script type="text/javascript">
    <!--
    var tempValue = document.getElementById("txtLocID").value;
    document.getElementById("txtLocID").value = "";
    document.getElementById("txtLocID").focus();
    document.getElementById("txtLocID").value = tempValue;
   //-->
</script>
